package com.wa.annotations.autowire_primary;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 *  1.没有标注  @Autowired，走无参的构造方法
 *  2.标注了 @Autowired,走标注了的有参构造方法
 **/
@Component
public class TestAutowired {
    private TestDao testDao;

    public TestAutowired(){
        System.out.println("空的构造函数");
    }

    @Autowired
    public TestAutowired(TestDao testDao){
        this.testDao = testDao;
        System.out.println("有参数的构造函数");
    }
}
